#include <stdio.h>

/*提莫攻击*/
int findPoisonedDuration(int* timeSeries, int timeSeriesSize, int duration) 
{
    int Total=0;
    for(int i=0;i<timeSeriesSize-1;i++)
    {
        if((timeSeries[i]+duration)>timeSeries[i+1])
        {
            Total+=timeSeries[i+1]-timeSeries[i];
        }
        else
        {
            Total+=duration;
        }
    }
    return Total+duration;
}


int main(int argc,char* argv[])
{
    int AttackTime[] = {1,4};
    int duration = 5;
    int len = sizeof(AttackTime)/4;
    printf("中毒时间为: %d秒\n",findPoisonedDuration(AttackTime,len,duration));
    return 0;
}